package com.ruibang.glass.material.controller;

import com.ruibang.glass.material.domain.req.MaterialBalanceReq;
import com.ruibang.glass.material.domain.req.MaterialInAndOutRecordReq;
import com.ruibang.glass.material.service.MaterialBalanceService;
import com.ruibang.glass.material.service.MaterialInAndOutRecordsService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 结存报表
 * </p>
 *
 * @author mameng
 * @since 2024-04-28
 */
@RestController
@RequestMapping("/api/material/balance/record")
@Api(value = "结存报表", tags = {"结存报表"})
public class MaterialBalanceController {
    @Autowired
    private MaterialBalanceService materialBalanceService;


    @PostMapping("/pageList")
    @ApiOperation(value = "全模块结存报表", response = ResultBody.class)
    public ResultBody getPageList(@RequestBody MaterialBalanceReq materialInAndOutRecordReq) {
        return ResultBody.success(materialBalanceService.getMaterialBalanceDTOPage(materialInAndOutRecordReq));
    }
    @PostMapping("/bcpPageList")
    @ApiOperation(value = "半成品结存报表", response = ResultBody.class)
    public ResultBody bcpPageList(@RequestBody MaterialBalanceReq materialInAndOutRecordReq) {
        return ResultBody.success(materialBalanceService.getBCPMaterialBalanceDTOPage(materialInAndOutRecordReq));
    }
    @PostMapping("/cpPageList")
    @ApiOperation(value = "成品结存报表", response = ResultBody.class)
    public ResultBody cpPageList(@RequestBody MaterialBalanceReq materialInAndOutRecordReq) {
        return ResultBody.success(materialBalanceService.getCPMaterialBalanceDTOPage(materialInAndOutRecordReq));
    }


}
